<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // document.write('来旅梦，去名企');
        // {}用于创建对象 key: vaule
        // 男主角
        // var let const 区别
        // 未定义？ undefind 值未定义，在内存中的分配没有确定
    let num;
    console.log(num);
    num = 1;
    let a = null;

    let nzx = {
        hobbies: ["羽毛球","干饭"],
        name: '聂紫祥',
        sex: '男',
        hometown: '丰城',
        college: '东华理工大学',
        rome: '942',
        isSingle: true,
        age: 22,
        face: 90,
        sendFlower(target) {
            target.receiveFlower(this)
        }
    }
    // 送花
    //女主角 
    let xh = {
        name: '小红',
        xq: 50,
        receiverFlower(sender){
        /*  if(sender.face<90){
                console.log('你是个好人')
            } else{
                console.log('万达走一波')
            }    */
            if(this.xq < 80){
                console.log('滚~~~')
            } else {
                console.log('万达走一波')
            }
            console.log(this.name+'收到了'+sender.name+'的花')   
        }  
    }
    let xm = {
        name: '小美',
        hometown: '丰城',
        receiverFlower(sender){
             /* if (sender.name == '聂紫祥'){
                    console.log('聂总哥，让我们在一起吧...')
                } else{
                    xh.receiverFlower(sender)
                }  */
                setTimeout(() => {
                    xh.xq = 90;
                    xh.receiverFlower(sender)
                },3000)
            }
    }

    </script>
</body>
</html>